package com.fatgirl.utils
{

	/**
	 * 生成唯一ID
	 * 根据类型分配
	 * 估计INT足够使用 
	 * @author iceman
	 * 
	 */
	public class IDCreator
	{
		private static var s_list:Array = new Array;
		public static function getAloneID(_key:String):int
		{
			var t_index:int;
			if(s_list[_key] == null)
			{
				s_list[_key] = int.MIN_VALUE;
			}
			else
			{
				t_index = s_list[_key];
				if(t_index+1>int.MAX_VALUE)
				{
					throwError(IDCreator,FatError.IDCREATOR_OVER_MAX);
				}
				s_list[_key] = t_index+1;
			}
			return s_list[_key] as int;
		}
	}
}